package com.ant.storage.service;

import com.ant.storage.common.ResultVo;
import com.ant.storage.dto.GoodsPoolDto;
import com.ant.storage.dto.MergeDto;
import com.ant.storage.pojo.AuditList;
import com.ant.storage.pojo.GoodsPool;
import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import com.taobao.api.ApiException;
import org.springframework.validation.BindingResult;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author melon
 * @since 2022-03-17
 */
public interface IGoodsPoolService extends IService<GoodsPool> {

    PageInfo<GoodsPool> getGoodsPoolList(GoodsPoolDto goodsPoolDto);

    /**
     * 保存申请单
     * @param goodsPool
     * @param bindingResult
     * @return
     */
    ResultVo saveGoodsPool(GoodsPool goodsPool, BindingResult bindingResult) throws ApiException;

    ResultVo updateGoodsPool(GoodsPoolDto goodsPoolDto, BindingResult bindingResult);

    ResultVo adoptApply(Integer id);

    Integer getprocessInstanceIdById(String processInstanceId);

   // ResultVo test(GoodsPool goodsPool, BindingResult bindingResult) throws Exception;

    GoodsPool getGoodsPoolDetailsById(Integer id);

    /**
     * 合并申请单
     * @param dto
     * @return
     */
    ResultVo mergeApply(MergeDto dto);

    /**
     * 申请单拆分
     * @param goodsPoolDto
     * @return
     */
    PageInfo<GoodsPool>  getAppletsGoodsPoolList(GoodsPoolDto goodsPoolDto);

    /**
     * 分配申请单
     * @param nameId
     * @param ids
     * @return
     */
    ResultVo getDistributionGoodsPool(Integer nameId, Integer[] ids);

    /**
     * 小程序查询合并申购详情
     * @param ids
     * @return
     */
    ResultVo getMergeApply(Integer[] ids);

    /**
     * 小程序完成签收
     * @param id
     * @return
     */
    ResultVo signInCompleted(Integer id);

    AuditList selectIsAudit(String processInstanceId, String user_id);

    PageInfo<GoodsPool> getAppletGoodsPoolList(GoodsPoolDto goodsPoolDto);

    GoodsPool getAppletGoodsPoolDetailsById(Integer id);
}
